package event_lite

import (
	"net"
)

// UDP Event Handler

type ServiceProvider struct {
	Conn *net.UDPConn
}

type ServiceOpt struct {
	Host string
	Port int
}

type ServiceOptFunc func(opt *ServiceOpt)

var WithHost = func(host string, port int) ServiceOptFunc {
	return func(opt *ServiceOpt) {
		opt.Host = host
		opt.Port = port
	}
}

func (sp *ServiceProvider) Close() {
	if sp.Conn == nil {
		return
	}
	_ = sp.Conn.Close()
}
